import re
text = "abc, Abc, ABC"
m = re.search(r"abc", text, flags=re.I)
print(m.group())